package com.project.logistics.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.logistics.bean.Repairs;
import com.project.logistics.bean.UserDetail;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * Created by94988 on 2021/3/30 15:11
 */
@Mapper
public interface UserDetailMapper extends BaseMapper<UserDetail> {

    @Select("select * from user_detail where user_id = #{userId}")
    UserDetail getUserDetailById(String userId);

    //添加当前用户报修
    @Insert("insert into user_detail(`user_id`,`user_name`) values(#{userId},#{userName})")
    void insertUserDetail(UserDetail userDetail);

    //修改当前报修单
    @Update("update user_detail set user_name=#{userName} where user_id=#{userId}")
    void updateUserDetail(UserDetail userDetail);
}
